package com.flong;

import com.flong.vo.Person;
import com.flong.vo.Student;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Stream;

/**
 * @Author:liangjl
 * @Date: 2020/6/21-17:11
 * @Eamil:jilongliang@sina.com
 * @Description:
 */
public class DataUtils {

    public static List<Person> personList() {
        Person p1 = Person.builder().username("周伯通").age(100).address("广东").build();
        Person p2 = Person.builder().username("瑛姑").age(89).address("北京").build();
        Person p3 = Person.builder().username("一灯大师").age(120).address("海南").build();
        Person p4 = Person.builder().username("小龙女").age(60).address("古墓").build();
        Person p5 = Person.builder().username("杨过").age(47).address("邵阳").build();
        List<Person> objects = new ArrayList<>();
        objects.add(p1);
        objects.add(p2);
        objects.add(p3);
        objects.add(p4);
        objects.add(p5);
        return objects;
    }

    public static Stream<Person> personStream() {
        Stream<Person> studentStream = Stream.of(
                Person.builder().username("周伯通").age(100).address("广东").build(),
                Person.builder().username("瑛姑").age(89).address("北京").build(),
                Person.builder().username("一灯大师").age(120).address("海南").build(),
                Person.builder().username("小龙女").age(60).address("古墓").build(),
                Person.builder().username("杨过").age(47).address("邵阳").build()
        );
        return studentStream;
    }

    public static List<Student> studentList() {
        Student p1 = Student.builder().userName("周伯通").age(100).socre(80d).build();
        Student p2 = Student.builder().userName("瑛姑").age(89).socre(90d).build();
        Student p3 = Student.builder().userName("一灯大师").age(120).socre(120d).build();
        Student p4 = Student.builder().userName("小龙女").age(60).socre(50d).build();
        Student p5 = Student.builder().userName("杨过").age(47).socre(100d).build();
        List<Student> objects = new ArrayList<>();
        objects.add(p1);
        objects.add(p2);
        objects.add(p3);
        objects.add(p4);
        objects.add(p5);
        return objects;
    }
    public static Stream<Student> studentStream() {
        Stream<Student> studentStream = Stream.of(
             Student.builder().userName("周伯通").age(100).sex("男").socre(80d).build(),
             Student.builder().userName("瑛姑").age(89).sex("女").socre(90d).build(),
             Student.builder().userName("一灯大师").age(120).sex("男").socre(120d).build(),
             Student.builder().userName("小龙女").age(60).sex("女").socre(50d).build(),
             Student.builder().userName("杨过").age(47).sex("男").socre(100d).build()
        );
        return studentStream;
    }


}
